package com.mosai.alignpro.entity;

import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;

/**
 * Created by Rays on 2020/3/27.
 */
public class LastParam implements Serializable {
    public static final String PARAM_SKIP_COUNT = "SkipCount";
    public static final String PARAM_CATEGORY = "Category";
    public static final String PARAM_MAX_RESULT_COUNT = "MaxResultCount";

    public static final String DEFAULT_MAX_RESULT_COUNT = "10";

    public static final String CATEGORY_ALL = "All";
    public static final String CATEGORY_AUDITED = "Audited";
    public static final String CATEGORY_WAITING = "Waiting";

    @JSONField(name = PARAM_SKIP_COUNT)
    private int skipCount;
    @JSONField(name = PARAM_MAX_RESULT_COUNT)
    private int maxResultCount;
    @JSONField(name = PARAM_CATEGORY)
    private String category;
    private int totalCount;
    private int patientId;

    public int getSkipCount() {
        return skipCount;
    }

    public void setSkipCount(int skipCount) {
        this.skipCount = skipCount;
    }

    public int getMaxResultCount() {
        return maxResultCount;
    }

    public void setMaxResultCount(int maxResultCount) {
        this.maxResultCount = maxResultCount;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPatientId() {
        return patientId;
    }

    public void setPatientId(int patientId) {
        this.patientId = patientId;
    }

    public void decrement() {
        totalCount = Math.max(0, totalCount - 1);
        skipCount = Math.max(0, skipCount - 1);
    }

    public boolean isAudited() {
        return CATEGORY_AUDITED.equalsIgnoreCase(category);
    }

    public boolean isWaiting() {
        return CATEGORY_WAITING.equalsIgnoreCase(category);
    }

    public boolean isAuditMode() {
        return !TextUtils.isEmpty(category);
    }

    public boolean isPatientDetailMode() {
        return patientId > 0;
    }

    public boolean isMore() {
        return skipCount < totalCount;
    }
}
